#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QList>
#include "Employee.h"

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private slots:
    void on_addButton_clicked();
    void on_deleteButton_clicked();
    void on_updateButton_clicked();
    void on_searchButton_clicked();
    void on_saveButton_clicked();
    void on_loadButton_clicked();
    void on_employeesTable_clicked(const QModelIndex &index);

private:
    Ui::MainWindow *ui;
    QList<Employee> employees;
    int currentIndex;

    void updateTable();
    void clearForm();
    void loadEmployeeToForm(int index);
};
#endif // MAINWINDOW_H
